L=1000000000; S=1; T=2; M=100; stones=[179783935,179783937,179783936,24405235,25782563,179783938,181037301,464200929,179783939,406978601,57637009,481706849,246165923,65295297,119091241,232603141,655989983,347207941,24870801,305959739,179430294,179430297,179430293,364608283,467460001,83169256,898162903,179430296,328716741,40416706,416332671,179430295,124924146,87586851,448313416,269661865,601712110,514098256,70215652,129118826,166731882,166731885,166731883,166731884,648167185,275119909,166731881,133715098,266349913,840913433,149098351,159605473,293995141,13321451,268020833,980490938,35222293,454277291,80137981,288284664,624108797,624108794,584888963,624108798,74310643,562138466,4785193,624108795,830441,522467853,242868565,624108796,7676314,123588121,47412781,46102966,544369588,770964607,195155445,860620308,347339763,347339764,686665839,347339761,17129113,547666537,347339765,664013000,183266113,347339762,121221361,21131517,21743997,281893821,4969945,475366169,16082019,99881101,42027005,45449160];